fix(@angular/build): fix setup files duplicate modules#31791
Open
yjaaidi wants to merge 2 commits intoangular:mainfrom
Open
fix(@angular/build): fix setup files duplicate modules#31791yjaaidi wants to merge 2 commits intoangular:mainfrom
yjaaidi wants to merge 2 commits intoangular:mainfrom
Conversation
This includes setup files in the initial build and avoids lazy discovery and thus module duplicates. Module duplicates can break many things such as dependency injection. Closes angular#31732
Contributor
Author
|
I tried to keep this the less intrusive possible but I wonder if the right fix wouldn't involve changes to |
yjaaidi
commented
Nov 13, 2025
| * @param options Configuration options for generating entry points. | ||
| * @returns A map where keys are the generated unique bundle names and values are the original file paths. | ||
| */ | ||
| export function getSetupEntrypoints( |
Contributor
Author
There was a problem hiding this comment.
I'm not happy with this.
I would rather have a single getEntrypoints that returns both test files and setup files then we would have to forward the setup file names to the executor somehow.
| projectSourceRoot, | ||
| workspaceRoot, | ||
| removeTestExtension, | ||
| prefix: 'setup', |
Contributor
Author
There was a problem hiding this comment.
This produces bundles named setup-test-setup which is weird.
An empty string would be better but collisions could happen with a setup file called spec-setup... or something.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This includes setup files in the initial build and avoids lazy discovery and thus module duplicates.
Module duplicates can break many things such as dependency injection.
setupFilesdirectly provided to the builder.Handling
setupFilesfrom the Vitest config requires substantial additional effort.PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #31732
What is the new behavior?
Does this PR introduce a breaking change?
Other information